﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Mes.Application.DTO.Results.Quality
{
    public class SampleFreqResult
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int Freq_Id { get; set; }

        /// <summary>
        /// 采样计划频率名称
        /// </summary>
        public string Freq_Name { get; set; } = string.Empty;

        /// <summary>
        /// 采样计划频率描述
        /// </summary>
        public string? Freq_Desc { get; set; }

        /// <summary>
        /// 是否启用
        /// Is this sample plan frequency to be used at runtime
        /// </summary>
        public bool Enabled { get; set; } = true;

        /// <summary>
        /// 采样计划频率类型
        /// 0 = shift, 1 (default) = calendar time, 2 = run time, 3 = production, 4 and up = data change event (see DB documentation for details)
        /// </summary>
        public int Freq_Type { get; set; } = 1;

        /// <summary>
        /// 最新更新时间
        /// </summary>
        public DateTime Last_Edit_At { get; set; } = DateTime.Now;
    }

    public class SampleFreqDetailResult: SampleFreqResult
    {
        /// <summary>
        /// 间隔
        /// If freq_type = 0, 1, or 2, the amount of time between samples(integers only).  If freq_type = 3, the amount of production between samples.  In either case, the meaning of amount is specified in the interval_unit field
        /// </summary>
        public float? Interval { get; set; }

        /// <summary>
        /// 间隔单位0-秒 1-分 2-时 3-日 4-周
        /// </summary>
        public int? Interval_Unit { get; set; }

        /// <summary>
        /// 生产未来样本
        /// Used only if freq_type = 0.  Offset from the end of the shift
        /// </summary>
        public int? Offset_End { get; set; }

        /// <summary>
        /// 生产未来样本单位
        /// </summary>
        public int? Offset_End_Unit { get; set; }

        /// <summary>
        /// 备用字段1
        /// </summary>
        public string? Spare1 { get; set; }

        /// <summary>
        /// 备用字段2
        /// </summary>
        public string? Spare2 { get; set; }

        /// <summary>
        /// 备用字段3
        /// </summary>
        public string? Spare3 { get; set; }

        /// <summary>
        /// 备用字段4
        /// </summary>
        public string? Spare4 { get; set; }
    }
}
